package com.zpark.service.impl;

import com.zpark.dao.IAccountDao;
import com.zpark.pojo.Account;
import com.zpark.service.IAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 账户业务层实现类
 */
@Service("accountService")
public class AccountServiceImpl implements IAccountService {

    @Autowired
    private IAccountDao accountDao;

    @Override
    public List<Account> findAll() {
        return accountDao.selectAll();
    }

    @Override
    public Account findById(Integer id) {
        return accountDao.selectById(id);
    }

    @Override
    public Integer add(Account account) {
        return accountDao.insert(account);
    }

    @Override
    public Integer change(Account account) {
        return accountDao.update(account);
    }

    @Override
    public Integer remove(Integer id) {
        return accountDao.delete(id);
    }
}
